package cn.hill4j.tool.spring.ext.mvc;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter;

/**
 * ClassName: DecEncDelegatingWebMvcConfiguration
 * Description: 加解密定义WebMvcConfigurationSupport
 * @author hillchen
 * Date: 2023/8/13
 * @version: 1.0
 */
public class DecEncWebMvcConfigurationSupport extends WebMvcConfigurationSupport {
    /**
     * @author hillchen
     * Description: 定义RequestMappingHandlerAdapter bean
     * Date: 2023/8/13 00:31
     * @return RequestMappingHandlerAdapter
     **/
    @Override
    protected RequestMappingHandlerAdapter createRequestMappingHandlerAdapter() {
        return new DecRequestMappingHandlerAdapter();
    }
    /**
     * @author hillchen
     * Description: 定义加解密策略注册器bean
     * Date: 2023/8/13 00:31
     * @return RequestDecEncStrategyRegister
     **/
    @Bean
    @ConditionalOnMissingBean
    protected RequestDecEncStrategyRegister requestDecEncStrategyRegister(){
        return new RequestDecEncStrategyRegister();
    }
}
